1. Field of the Invention
This invention relates to a magnetic sensor and a magnetic measurement method, and more particularly to a magnetic sensor and a magnetic measurement method using a Hall element.
2. Background Art
Conventionally, magnetic sensors using Hall elements have been developed. A Hall element is a semiconductor element which detects magnetic field using the Hall effect. The Hall effect is a phenomenon in which, when a magnetic field is applied in a direction orthogonal to the current flowing direction, a voltage (Hall voltage) occurs in the direction orthogonal to both the current direction and the magnetic field direction.
A Hall element illustratively includes a square diffusion region in an upper portion of a silicon substrate. This diffusion region is illustratively an N-type region surrounded by a P-type region. A current is passed along a first direction in this diffusion region. At this time, if a magnetic field is applied in the direction perpendicular to the upper surface of the silicon substrate, a Hall voltage occurs along a second direction orthogonal to the first direction in the diffusion region. The magnetic field is detected by measuring this Hall voltage.
In such a Hall element, besides the Hall voltage, an offset voltage may occur due to, for instance, the stress applied to the silicon substrate and the error of the shape of the diffusion region. If an offset voltage occurs, a certain voltage is unfortunately detected even without application of a magnetic field to the Hall element. In this regard, U.S. Pat. No. 4,037,150 and JP-A-2001-337147 disclose a technique for canceling the effect of the offset voltage by performing the measurement twice with the direction of passing a current and the direction of measuring the voltage interchanged with each other, and calculating the sum or difference of the measurement results.
However, even the above technique for performing the measurement twice cannot completely cancel the effect of the offset voltage, but a residual component of the offset voltage remains in the measured voltage. The polarity of this residual component depends on the direction of the magnetic field to be detected. Hence, in such cases as binary determination in which the presence or absence of magnetism is determined by whether the absolute value of the measured voltage exceeds a certain threshold, there is a problem of inaccurate detection if the polarity of magnetism to be detected is unknown.
Such a magnetic sensor is illustratively used to detect the open/closed state of a mobile phone. In this case, a magnet is provided in one part of the foldable mobile phone, and a magnetic sensor is provided in the other part thereof, so that the magnet comes near the magnetic sensor when the mobile phone is closed. When the voltage generated in the Hall element exceeds a predetermined threshold, it is determined that the mobile phone is closed. Here, if the arrangement direction of the magnet is completely controlled, the polarity of the magnet on the magnetic sensor side is fixed to one of the S pole and the N pole, which allows detection in consideration of the residual component. However, if the arrangement direction of the magnet is not controlled, the detection accuracy decreases because the polarity of the magnet is unknown.
Conventionally, in such cases, the magnetic sensor includes two Hall elements, one for detecting the N pole and one for detecting the S pole. This is an obstacle to downsizing the magnetic sensor.